<?php
namespace Home\Widget;
use Think\Controller;

class HomeWidget extends Controller
{
    /*
     * 获取分类*/
    function get_all_categorys()
    {
        $this->category=M('category')->order('id desc')->field('id,cname')->select();
        //p($this->category);die();
        $this->display('Widget/category');
    }
    /*
     * 获取表前列*/
    function get_all_tags()
    {
        $this->tags=M('tag')->order('tid desc')->field('tid,tname')->select();
//        p($this->tags);die();
        $this->display('Widget/tag');
    }
}